package cscie160.project;

import java.util.EnumSet;

/**
 * Created with IntelliJ IDEA.
 * User: Jim
 * Date: 12/14/12
 * Time: 5:06 PM
 * To change this template use File | Settings | File Templates.
 */
public class AccountSecurityInfo {
    private int accountNumber;
    private int PIN;
    private EnumSet<Commands> authorizedCommands;

    public AccountSecurityInfo(int accountNumber, int PIN, EnumSet<Commands> authorizedCommands)
    {
        this.accountNumber = accountNumber;
        this.PIN = PIN;
        this.authorizedCommands = authorizedCommands.clone();

    }

    int getAccountNumber()
    {
        return accountNumber;
    }

    void setAccountNumber(int accountNumber)
    {
        this.accountNumber = accountNumber;
    }

    int getPIN()
    {
        return PIN;
    }

    void setPIN(int PIN)
    {
        this.PIN = PIN;
    }

    void addAuthorization(Commands command)
    {
        authorizedCommands.add(command);
    }

    void removeAuthorization(Commands command)
    {
        authorizedCommands.remove(command);
    }

    boolean hasAuthorization(Commands command)
    {
        return authorizedCommands.contains(command);
    }
}
